﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace ScheduleMaker
{
    public class regexpHelper
    {
        private static regexpHelper instance;

        private regexpHelper() { }

        public static regexpHelper Instance
        {
            get
            {
                if (instance == null)
                {
                    instance = new regexpHelper();
                }
                return instance;
            }
        }

        // Sprawdzanie poprawności wprowadzonych danych
        public bool isNameCorrect(String name)
        {
            //ąćęłńóśźżĄĆĘŁŃÓŚŹŻ
            String wzorzec = "^[A-ZĄĆĘŁŃÓŚŹŻ][a-ząćęłńóśźż]{2,20}$";
            return Regex.IsMatch(name, wzorzec, RegexOptions.Multiline);
        }
        public bool isNickCorrect(String name)
        {
            String wzorzec = "^[A-Za-z0-9]{2,20}$";
            return Regex.IsMatch(name, wzorzec, RegexOptions.Multiline);
        }
        public bool isClassroomNameCorrect(String name)
        {
            String wzorzec = "^[A-Za-z0-9#_:\\s]{2,20}$";
            return Regex.IsMatch(name, wzorzec, RegexOptions.Multiline);
        }



    }
}
